package com.gopay.scheduler.job;

import com.gopay.common.util.DateUtils;
import com.gopay.cps.service.FundcTransoutSmsNotifyService;
import com.gopay.scheduler.GopayBaseJob;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.annotation.Resource;
import java.util.Date;

/**
 * @Description 转出提醒发送短信
 * @Author jianghp
 * @Date 2017/4/19 19:50
 * Copyright (c) 2017. www.gopay.com.cn Inc.All rights reserved.
 */
public class FundcSmsNotifyJob extends GopayBaseJob {

    private Logger logger = LoggerFactory.getLogger(this.getClass());

    @Resource(name = "fundcTransoutSmsNotifyService")
    private FundcTransoutSmsNotifyService fundcTransoutSmsNotifyService;

    @Override
    protected void doJobInternal() {
        try {
            logger.info("企业基金转出提醒发送短信开始！");
            String cronTime = DateUtils.date2string(new Date(),"yyyy-MM-dd HH:00");
            fundcTransoutSmsNotifyService.smsNotifyProcess(cronTime);
            logger.info("企业基金转出提醒发送短信结束！");
        } catch (Exception e) {
            logger.error("企业基金转出提醒发送短信出错！", e);
        }
    }


}
